@extends('admin.mainlayout')
@section('js')

@endsection
@section('content')
	<div class="main-wrap">


		<div class="crumb-wrap">
			<div class="crumb-list"><i class="icon-font"></i><a href="{:U('Index/index')}">首页</a><span class="crumb-step">&gt;</span><span class="crumb-name">第三方充值记录</span></div>
		</div>
		<!-- <div class="search-wrap">
            <div class="search-content">
                <div class="search-wrap">
                    <div class="search-content">
                        <form action="{:U('Pay/payByMan')}" method="post">
                            <table class="search-tab">
                                <tr>
                                    <th width="120">选择分类:</th>
                                    <td>
                                        <select name="status" id="">
                                            <option value="">全部</option>
                                            <option value="0">未付款</option>
                                            <option value="1">充值成功</option>
                                            <option value="2">充值失败</option>
                                            <option value="3">已失效</option>
                                        </select>
                                    </td>
                                    <th width="70">汇款人:</th>
                                    <td><input class="common-text" placeholder="汇款人" name="member_name" value="" id="" type="text"></td>
                                    <td><input class="btn btn-primary btn2" name="sub" value="查询" type="submit"></td>
                                </tr>
                            </table>
                        </form>
                    </div>
                </div>
            </div>
        </div> -->
		<div class="result-wrap">
			<form name="myform" id="myform" method="post">
			</form>
			<div class="result-tab">
				<div class="panel-actions" style="height:50px;">
					<h1 class="fl" style="line-height:50px; margin-left:20px;">
						<i class="icon-font"></i>
						数据统计状况
					</h1>
					<form action="{{urlAdmin('Tongji','getShuju')}}" method="get" class="form-inline form-search" style="fr">

						<div class="fr" style="line-height:50px;">
							<input type="text" name="userid" value=""  class="form-control search-query" style="width:20%;" placeholder="会员id" title="会员id" />
							<input type="text" name="stime" class="stime" placeholder="开始时间：如2016-03-22" title="开始时间" readonly="" style="margin-right:20px;" onclick="laydate()">
							<input type="text" name="etime" class="etime" placeholder="结束时间：如2016-04-21" title="结束时间" readonly="" style="margin-right:20px;" onclick="laydate()">

							<input type="submit" id="submit" class="btn btn-primary" value="搜索" data-loading="稍候..." style="margin-right:20px;">
						</div>
					</form>
				</div>
				<div class="" style="overflow:hidden;">
					<div class="fl" style="padding-bottom:10px; width:56%; margin-left:15px;">
						<strong>
							充值统计
						</strong>
						<table class="table table-hover table-striped table-bordered" style="width:100%; border: 1px solid #ddd;">
							<thead>
							<tr>
								<th class="text-center">币种</th>
								<th class="text-center">单数</th>
								<th class="text-center">充值总金额</th>
							</tr>
							</thead>
							<tbody>

								@foreach($alltj as $v)
								<tr>
									<td class="text-right ">{{isset($v['currency_mark'])?$v['currency_mark']:0}}</td>

									<td class="text-right"><a href="#">{{isset($v['paytj'][0]['allnum'])?$v['paytj'][0]['allnum']:0}}</a></td>
									<td class="text-right">{{isset($v['paytj'][0]['allmoney'])?$v['paytj'][0]['allmoney']:0}}</td>
								</tr>
								@endforeach

							</tbody>
						</table>
					</div>
					<div class="fl" style="padding-bottom:10px; width:40%; margin-left:10px;">
						<strong>
							提现统计
						</strong>
						<table class="table table-hover table-striped table-bordered" style="width:100%;border: 1px solid #ddd;">
							<thead>
							<tr>
								<th class="text-center w-100px">币种</th>
								<th class="text-center w-200px">单数</th>
								<th class="text-center w-300px">提现总金额</th>
							</tr>
							</thead>
							<tbody>

								@foreach($alltj as $v)
								<tr>
									<td class="text-right ">{{$v['currency_mark']}}</td>
									<td class="text-right"><a href="#">{{isset($v['tibitj'][0]['allnum'])?$v['tibitj'][0]['allnum']:0}}</a></td>
									<td class="text-right">{{isset($v['tibitj'][0]['allmoney'])?$v['tibitj'][0]['allmoney']:0}}</td>
								</tr>
								@endforeach

							</tbody>
						</table>
					</div>
					<div style="padding-bottom:10px; width:97%; clear:both; margin-left:15px;">
						<strong>
							挂单统计
						</strong>
						<table class="table table-hover table-striped table-bordered" style="width:100%;border: 1px solid #ddd;">
							<thead>
							<tr>
								<th class="text-center w-100px">交易类型</th>
								<th class="text-center w-200px">单数</th>
								<th class="text-center w-200px">交易数量</th>
								<th class="text-center w-300px">交易额</th>
							</tr>
							</thead>
							<tbody>
								@if(!empty($order))
								@foreach($order as $v)
								<tr>
									<td class="text-right ">{{$v['currency_name']['currency_mark']}}_{{$v['currency_trade_name']['currency_mark']}}</td>
									<td class="text-right "><a>{{$v['num']}}</a></td>
									<td class="text-right ">
										{{$v['jiaoyinum']}}					({{$v['currency_name']['currency_mark']}})</td>
									<td class="text-right ">
										{{$v['jiaoyiprice']}}				({{$v['currency_trade_name']['currency_mark']}})</td>
								</tr>
								@endforeach
								@endif

							<tr>
								<th colspan="2" class="text-right ">合计</th>
								<td class="text-right " colspan="2">CNY :
									{{isset($order[0]['allmoney'])?$order[0]['allmoney']:0}}
									<br>                        </td>
							</tr>

							</tbody>
						</table>
					</div>
				</div>


				<div class="" style="overflow:hidden;">
					<div style="padding-bottom:10px; width:97%; clear:both; margin-left:15px;">
						<strong>
							成交统计
						</strong>
						<table class="table table-hover table-striped table-bordered" style="width:100%; border: 1px solid #ddd;">
							<thead>
							<tr>
								<th class="text-center w-100px">交易类型</th>
								<th class="text-center w-200px">单数</th>
								<th class="text-center w-200px">交易数量</th>
								<th class="text-center w-300px">交易额</th>
							</tr>
							</thead>
							<tbody>
							@if(!empty($trade))
								@foreach($trade as $v)
								<tr>
									<td class="text-right ">{{$v['currency_name']['currency_mark']}}_{{$v['currency_trade_name']['currency_mark']}}</td>
									<td class="text-right "><a>{{$v['num']}}</a></td>
									<td class="text-right ">
										{{$v['jiaoyinum']}}					({{$v['currency_name']['currency_mark']}})</td>
									<td class="text-right ">
										{{$v['jiaoyiprice']}}				({{$v['currency_trade_name']['currency_mark']}})</td>

								</tr>

								@endforeach
							@endif
							<tr>
								<th colspan="2" class="text-right ">合计</th>
								<td colspan="2" class="text-right ">CNY :
									{{isset($trade['0']['allmoney'])?$trade['0']['allmoney']:0}}
									<br></td>
							</tr>

							</tbody>
						</table>
					</div>
					<!--<div style="padding-bottom:10px; width:97%; clear:both; margin-left:15px;">
                                <strong>
                                    充值卡统计
                                </strong>
                    <table class="table table-hover table-striped table-bordered" style="width:100%;border: 1px solid #ddd;">
                    <thead>
                        <tr>
                            <th colspan="5" class="warning">(充值卡的充值和提现金额已经在充值和提现中统计，这里的数字只是单独列出，方便查看，不需要计入财务报表)</th>
                        </tr>
                        <tr>
                            <th class="text-center w-100px">币种</th>
                            <th class="text-center w-200px">充值单数</th>
                            <th class="text-center w-200px">充值数量</th>
                            <th class="text-center w-200px">提现单数</th>
                            <th class="text-center w-200px">提现数量</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td class="text-right ">VRC</td>
                            <td class="text-right "><a href="/newadmin.php/Home/List/cardShow/?userid=&amp;coinid=5&amp;stime=2016-03-22&amp;etime=2016-04-21">0</a></td>
                            <td class="text-right ">0
                            </td>
                            <td class="text-right ">0</td>
                            <td class="text-right ">0
                            </td>
                        </tr><tr>
                            <td class="text-right ">CNY</td>
                            <td class="text-right "><a href="/newadmin.php/Home/List/cardShow/?userid=&amp;coinid=1&amp;stime=2016-03-22&amp;etime=2016-04-21">0</a></td>
                            <td class="text-right ">0
                            </td>
                            <td class="text-right ">0</td>
                            <td class="text-right ">0
                            </td>
                        </tr><tr>
                            <td class="text-right ">FHG</td>
                            <td class="text-right "><a href="/newadmin.php/Home/List/cardShow/?userid=&amp;coinid=8&amp;stime=2016-03-22&amp;etime=2016-04-21">0</a></td>
                            <td class="text-right ">0
                            </td>
                            <td class="text-right ">0</td>
                            <td class="text-right ">0
                            </td>
                        </tr><tr>
                            <td class="text-right ">NEC</td>
                            <td class="text-right "><a href="/newadmin.php/Home/List/cardShow/?userid=&amp;coinid=12&amp;stime=2016-03-22&amp;etime=2016-04-21">0</a></td>
                            <td class="text-right ">0
                            </td>
                            <td class="text-right ">0</td>
                            <td class="text-right ">0
                            </td>
                        </tr><tr>
                            <td class="text-right ">BLK</td>
                            <td class="text-right "><a href="/newadmin.php/Home/List/cardShow/?userid=&amp;coinid=13&amp;stime=2016-03-22&amp;etime=2016-04-21">0</a></td>
                            <td class="text-right ">0
                            </td>
                            <td class="text-right ">0</td>
                            <td class="text-right ">0
                            </td>
                        </tr><tr>
                            <td class="text-right ">BC</td>
                            <td class="text-right "><a href="/newadmin.php/Home/List/cardShow/?userid=&amp;coinid=14&amp;stime=2016-03-22&amp;etime=2016-04-21">0</a></td>
                            <td class="text-right ">0
                            </td>
                            <td class="text-right ">0</td>
                            <td class="text-right ">0
                            </td>
                        </tr>
                    </tbody>
                </table>
                    </div>-->
				</div>
				<div>
					<div style="float:right; clear:none;" class="page form-inline">
						<div class="pagination"></div>
					</div>
				</div>
			</div>
		</div>
	</div>

@endsection
@section('footer')
	<script>
		function pass(id){
			layer.confirm(
					'确定通过审核',
					{btn:['确定','取消']},
					function(){
						$.post("{:U('Pay/payUpdate')}",{"pay_id":id,"status":1},function(data){
							if(data.status==0){
								layer.msg(data['info']);
								setTimeout("location.reload()",2000);
							}else{
								layer.msg(data['info']);
								setTimeout("location.reload()",2000);
							}
						})
					}
			),
					function(){
						layer.msg('已取消');
					}
		}

		function fail(id){
			layer.confirm(
					'确定不通过审核',
					{btn: ['确定','取消'],},
					function(){
						//href="{:U('Pay/payUpdate',array('pay_id'=>$vo['pay_id'],'status'=>1))}
						$.post("{:U('Pay/payUpdate')}",{"pay_id":id,"status":2},function(data){
							if(data.status == 0){
								layer.msg(data['info']);
								setTimeout("location.reload()",2000);

							}else if(data.status == 2){
								layer.msg(data['info']);
								setTimeout("location.reload()",2000);
							}else{
								layer.msg(data['info']);
								setTimeout("location.reload()",2000);
							}
						})
					}
			),
					function(){
						layer.msg('已取消');
					}
		}
	</script>
	<script>
		$(".sub-menu").eq(11).show();
		$(".sub-menu").eq(11).children("li").eq(1).addClass("on");
	</script>
@endsection